package com.goddess.yeecolor.tools;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

/**
 * 跳转Intent
 */
public class JumpIntents {
    private static Intent intent;
    public static void startIntent(Activity context,Class cla){
        intent=new Intent(context,cla);
        context.startActivity(intent);
        context.overridePendingTransition(0,0);
    }
    public static void startIntent(Activity context,Class cla,Bundle bundle){
        intent=new Intent(context,cla);
        intent.putExtra("bundle",bundle);
        context.startActivity(intent);
        context.overridePendingTransition(0,0);
    }
    public static void startIntent(Activity context,Class cla,int request){
        intent=new Intent(context,cla);
        intent.setFlags(request);
        context.startActivityForResult(intent,request);
        context.overridePendingTransition(0,0);
    }

    /*
    跳转主界面显示
     */
    public static void startIntent(Activity context,Class cla,String request){
        intent=new Intent(context,cla);
        intent.putExtra("tag",request);
        context.startActivity(intent);
        context.overridePendingTransition(0,0);
    }

    public static void startIntentResult(Activity context,int request,String content){
        intent=new Intent();
        intent.putExtra("content",content);
        context.setResult(request,intent);
        context.finish();
        context.overridePendingTransition(0,0);
    }
    public static void startIntentResultIntent(Activity context, Class cla,int request, Bundle bundle){
        intent=new Intent(context,cla);
        intent.setFlags(request);
        intent.putExtra("bundle",bundle);
        context.startActivityForResult(intent,request);
        context.overridePendingTransition(0,0);
    }
    public static void startIntentResult(Activity context,int request,Bundle bundle){
        intent=new Intent();
        intent.putExtra("bundle",bundle);
        context.setResult(request,intent);
        context.finish();
        context.overridePendingTransition(0,0);
    }
    public static void startIntentCan(Activity context,Class cla,String tags){
        intent=new Intent(context,cla);
        intent.putExtra("tag",tags);
        context.startActivity(intent);
        context.overridePendingTransition(0,0);
    }
}
